@extends('layouts.app')
@section('content')
  <ul class="nav navbar-nav">
    <li><a href="{{ URL::to('items/create') }}">check in a new item</a>
   </ul>

  <div class="row">
        <div class="small-3 columns">
          <input type="text" id="filter" placeholder="search">
        </div>
  </div>

<table id='items_table' class="data-table" data-filter='#filter'>
  <thead>
    <tr>
      <th data-type="numeric" data-sort-initial="true">ID</th>
      <th>Name</th>
      <th>Checked In</th>
      <th>Checked Out</th>
      <th>Type</th>
      <th>Category</th>
      </tr>
    </thead>
  <tbody>
    @foreach($items as $key => $value)
    <tr class='data-table-row'>
      <td><a class="btn btn-small btn-success" href="{{ URL::to('items/' . $value->id) }}">{{ $value->id }}</a></td>
      <td><a class="btn btn-small btn-success" href="{{ URL::to('items/' . $value->id) }}">{{ $value->name }}</a></td>
      <td>{{ $value->created_at }}</td>
      <td>{{ $value->stock_out_at }}</td>
      <td>todo</td>
      <td>todo</td>

      <!-- we will also add show, edit, and delete buttons -->
      </tr>
    @endforeach
    </tbody>
</table>

<script type="text/javascript">
$(function () {
    $('#items_table').footable();
});
</script>

@stop